layui.form.verify({
    pwd: [/^[\S]{6,12}$/, '请输入6-12位密码'],
    repwd: function(val) {
        if (val !== $('.new-pwd').val()) {
            return '两次输入密码不一致'
        }
    }
})

$('.pwd_form').on('submit', function(e) {
    // console.log(888888);
    var that = $(this)
    e.preventDefault()
    $.ajax({
        url: '/my/updatepwd',
        method: 'POST',
        data: $(this).serialize(),
        success: function(res) {
            console.log(res);

            layer.msg(res.message)
            if (res.status === 0) {
                that[0].reset()
            }

        }

    })

})